package utils;

import java.text.SimpleDateFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Format {
	private static final String YEAR_REG="^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$";
	public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
	public static boolean verifyBirth(String birth){
		Pattern mPattern = Pattern.compile(YEAR_REG);
		Matcher matcher = mPattern.matcher(birth);
		int length = 0;
		while(matcher.find()){
			length++;
		}
		return length > 0 ? true:false;
	}
}
